package com.soulless.anonymous;

/**
 * <p>
 *
 * </p>
 *
 * @author zenglei
 * @date 2023/05/22/ 15:11
 */
public class Anonymous {

    public void test() {
        Father f = new Father() {
            @Override
            public void f1() {
                System.out.println("重写f1");
            }
        };

        f.f1();

        FatherInterface fi = new FatherInterface() {
            @Override
            public void f1() {
                System.out.println("接口f1");
            }

            @Override
            public void f2() {
                System.out.println("接口f2");
            }
        };

        fi.f1();
        fi.f2();
    }

}
